<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微服务架构演示</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
            color: #333;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        h1 {
            color: #2c3e50;
            border-bottom: 2px solid #3498db;
            padding-bottom: 10px;
        }
        h2 {
            color: #2980b9;
            margin-top: 30px;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            margin: 5px;
            text-decoration: none;
        }
        .btn:hover {
            background-color: #2980b9;
        }
        .feature-list {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            margin-top: 20px;
        }
        .feature-card {
            flex: 1;
            min-width: 300px;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 20px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .feature-card h3 {
            margin-top: 0;
            color: #3498db;
        }
        .feature-card p {
            margin-bottom: 20px;
        }
        .footer {
            margin-top: 50px;
            text-align: center;
            color: #7f8c8d;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>微服务架构演示系统</h1>
        <p>本系统演示了基于Spring Cloud的微服务架构，包括服务注册发现、负载均衡、服务调用等功能。</p>
        
        <div class="feature-list">
            <div class="feature-card">
                <h3>负载均衡演示</h3>
                <p>演示Spring Cloud LoadBalancer的负载均衡功能，通过轮询策略在多个服务实例之间分发请求。</p>
                <a href="/api/demo/text" class="btn">负载均衡测试</a>
            </div>
            
            <div class="feature-card">
                <h3>OpenFeign服务调用</h3>
                <p>演示使用OpenFeign进行微服务之间的接口调用，包括负载均衡、熔断降级等功能。</p>
                <a href="/feign-demo.html" class="btn">OpenFeign演示</a>
            </div>
            
            <div class="feature-card">
                <h3>服务注册与发现</h3>
                <p>展示服务如何注册到Consul服务注册中心，以及如何发现和调用其他服务。</p>
                <a href="/api/demo/instances" class="btn">查看服务实例</a>
            </div>
        </div>
        
        <h2>API接口列表</h2>
        <ul>
            <li><a href="/api/demo/instances">查看服务实例列表</a> (不使用负载均衡)</li>
            <li><a href="/api/demo/instances-lb">查看服务实例列表</a> (使用负载均衡)</li>
            <li><a href="/api/demo/text">负载均衡测试(文本)</a> (使用LoadBalancerClient)</li>
            <li><a href="/api/demo/direct/text">直接负载均衡调用(文本)</a> (使用@LoadBalanced RestTemplate)</li>
            <li><a href="/api/integration/lost-found/items/1">获取失物信息</a> (使用OpenFeign调用)</li>
            <li><a href="/api/integration/lost-found/health">检查失物招领服务健康状态</a> (使用OpenFeign调用)</li>
        </ul>
        
        <div class="footer">
            <p>微服务架构演示系统 | Spring Cloud LoadBalancer & OpenFeign</p>
        </div>
    </div>
</body>
</html>